package com.dyna.foundation.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dyna.constants.DateFatter;
import com.dyna.enums.CommonStatusEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 
 * @author Admin
 * @TableName user
 */

@Data
@ApiModel(value = "用户表")
@TableName(value = "sys_user")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户uuid")
    @TableId(type = IdType.AUTO)
    private Long userId;

    @ApiModelProperty(value = "部门 ID")
    private Long deptId;

    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名")
    private String username;

    @NotBlank(message = "用户姓名不能为空")
    @ApiModelProperty(value = "用户姓名")
    private String nickName;

    @ApiModelProperty(value = "头像")
    private String avatar;

    @NotBlank(message = "密码不能为空")
    @ApiModelProperty(value = "密码")
    private String password;

    @NotNull(message = "性别不能为空")
    @ApiModelProperty(value = "性别", notes = "1：男，2，0未知")
    private Integer sex;

    @ApiModelProperty(value = "手机号")
    @NotBlank(message = "手机号不能为空")
    private String phone;

    @ApiModelProperty(value = "身份证")
    @NotBlank(message = "身份证不能为空")
    private String idCard;

    /**
     * 帐号状态
     * 枚举 {@link CommonStatusEnum}
     */
    @ApiModelProperty(value = "帐号状态")
    private Integer status;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = DateFatter.YYYY_MM_DD_HH_MM_SS)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "删除标识", notes = "0: 未删除，2删除")
    private Integer delFlag;

}